libxl: IDL: bring command line handling in genwrap.py into one place.
authorIan Campbell <ian.campbell@citrix.com>
Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 14 Jul 2011 12:22:36 +0000 (13:22 +0100)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
tools/libxl/gentypes.py

index 8c8ffc26dfc6344c82b787941e0e3dd64d08709e..120c6d357e5b2d521f0033f89a1ada66eecae7f5 100644 (file)
@@ -137,14 +137,14 @@ def libxl_C_enum_from_string(ty, str, e, indent = "    "):
     
 
 if __name__ == '__main__':
-    if len(sys.argv) < 4:
+    if len(sys.argv) != 4:
         print >>sys.stderr, "Usage: gentypes.py <idl> <header> <implementation>"
         sys.exit(1)
 
-    idl = sys.argv[1]
+    (_, idl, header, impl) = sys.argv
+
     (_,types) = libxltypes.parse(idl)
                     
-    header = sys.argv[2]
     print "outputting libxl type definitions to %s" % header
 
     f = open(header, "w")
@@ -174,7 +174,6 @@ if __name__ == '__main__':
     f.write("""#endif /* __LIBXL_TYPES_H */\n""")
     f.close()
     
-    impl = sys.argv[3]
     print "outputting libxl type implementations to %s" % impl
 
     f = open(impl, "w")